package com.dongline.test.gongtonghaoyou;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class FriendReducer extends Reducer<Text,Text,Text,Text> {
    @Override
    protected void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        String friends="";
        for(Text friend:values)
        {

            friends=friends+","+friend.toString();
        }
        context.write(key,new Text(friends));
    }
}
